package spolipar.bitcoin.bot.data;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

public abstract class DataFetcher {
	
	public abstract StorageKey sotrageKey();
	
	public abstract IMarketData fetchData(MarketDataType type) throws IOException;
	
	protected HttpURLConnection openHttpConnection(String urlString) throws IOException {
		URL url = new URL(urlString);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setReadTimeout( 10000 );
        connection.setConnectTimeout( 10000 );
        return connection;
	}
	
	
}
